//
//  Order.m
//  AppleCilent
//
//  Created by Nail Sharipov on 06/04/14.
//  Copyright (c) 2014 Nail Sharipov. All rights reserved.
//

#import "CartOrder.h"

@implementation CartOrder
{
    int quantity;
    GoodsDomain* goods;
}

- (id)init:(GoodsDomain*) goodsDomain {
    self = [super init];
    goods = goodsDomain;
    quantity = 0;
    return self;
}

- (int) getQuantity
{
    return quantity;
}
- (void) setQuantity:(int) newQuantity
{
    quantity = newQuantity;
}
- (GoodsDomain*) getGoods
{
    return goods;
}

- (NSString*) toJSON {
    return [NSString stringWithFormat:@"{\"goodsId\":%i,\"quantity\":%i}", [goods getId], quantity];
}

@end
